/*
** Lua binding: sys
** Generated automatically by tolua++-1.0.92 on Wed Mar 16 22:59:51 2016.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

/* Exported function */
TOLUA_API int  tolua_sys_open (lua_State* tolua_S);

#include "node/sys/console.h"
#include "node/sys/thread.h"
using Console = ::node::sys::Console;
using Thread = ::node::sys::Thread;

/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
 tolua_usertype(tolua_S,"Thread");
 tolua_usertype(tolua_S,"Console");
}

/* method: Info of class  Console */
#ifndef TOLUA_DISABLE_tolua_sys_Console_Info00
static int tolua_sys_Console_Info00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"Console",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* format = ((const char*)  tolua_tostring(tolua_S,2,0));
  {
   Console::Info(format);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Info'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: Log of class  Console */
#ifndef TOLUA_DISABLE_tolua_sys_Console_Log00
static int tolua_sys_Console_Log00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"Console",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* format = ((const char*)  tolua_tostring(tolua_S,2,0));
  {
   Console::Log(format);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Log'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: Warning of class  Console */
#ifndef TOLUA_DISABLE_tolua_sys_Console_Warning00
static int tolua_sys_Console_Warning00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"Console",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* format = ((const char*)  tolua_tostring(tolua_S,2,0));
  {
   Console::Warning(format);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Warning'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: Error of class  Console */
#ifndef TOLUA_DISABLE_tolua_sys_Console_Error00
static int tolua_sys_Console_Error00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"Console",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  const char* format = ((const char*)  tolua_tostring(tolua_S,2,0));
  {
   Console::Error(format);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Error'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: GetCurrentThreadId of class  Thread */
#ifndef TOLUA_DISABLE_tolua_sys_Thread_GetCurrentThreadId00
static int tolua_sys_Thread_GetCurrentThreadId00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"Thread",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   unsigned long tolua_ret = (unsigned long)  Thread::GetCurrentThreadId();
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'GetCurrentThreadId'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: Sleep of class  Thread */
#ifndef TOLUA_DISABLE_tolua_sys_Thread_Sleep00
static int tolua_sys_Thread_Sleep00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"Thread",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  int msec = ((int)  tolua_tonumber(tolua_S,2,0));
  {
   Thread::Sleep(msec);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Sleep'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
TOLUA_API int tolua_sys_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,0);
 tolua_beginmodule(tolua_S,NULL);
  tolua_cclass(tolua_S,"Console","Console","",NULL);
  tolua_beginmodule(tolua_S,"Console");
   tolua_function(tolua_S,"Info",tolua_sys_Console_Info00);
   tolua_function(tolua_S,"Log",tolua_sys_Console_Log00);
   tolua_function(tolua_S,"Warning",tolua_sys_Console_Warning00);
   tolua_function(tolua_S,"Error",tolua_sys_Console_Error00);
  tolua_endmodule(tolua_S);
  tolua_cclass(tolua_S,"Thread","Thread","",NULL);
  tolua_beginmodule(tolua_S,"Thread");
   tolua_function(tolua_S,"GetCurrentThreadId",tolua_sys_Thread_GetCurrentThreadId00);
   tolua_function(tolua_S,"Sleep",tolua_sys_Thread_Sleep00);
  tolua_endmodule(tolua_S);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 TOLUA_API int luaopen_sys (lua_State* tolua_S) {
 return tolua_sys_open(tolua_S);
};
#endif

